package main

import "fmt"

//算算你的脸有多大
const PI float32 = 3.14

var radio int
var area float32

func demo41() {
	radio = 5
	area = PI * float32(radio) * float32(radio)
	fmt.Println("大脸猫的脸有这么大：", area)
	fmt.Printf("你的脸有%f辣莫大\n", area)
	fmt.Printf("你的脸有%.2f辣莫大\n", area)
	fmt.Printf("你的脸有%10.2f辣莫大\n", area)
	fmt.Printf("你的脸有%-10.2f辣莫大\n", area)
}

func getCircleArea(r float32) {
	result := PI * r * r
	fmt.Printf("半径为%.2f脸有%.2f辣莫大\n", r, result)
}

func get_circle_area(r float32) (result float32) {
	result = PI * r * r
	fmt.Printf("半径为%.2f脸有%.2f辣莫大\n", r, result)
	return
}

func main() {
	//demo41()
	getCircleArea(5)
	fmt.Printf("脸有%.2f辣莫大\n", get_circle_area(5))
}
